# name  = "asdadd"
# mima = "12313123"
# i = 3
# while i>0:
#     i = i - 1
#     a = input("请输入用户名：")
#     b = input("请输入密码：")
#
#     if a == name:
#         if b == mima:
#             print("欢迎登陆")
#             break
#         else:
#             if i == 0:
#                 print("没机会了")
#             else:
#                 print("密码错误还剩{}次".format(i))
#     else:
#         if i == 0:
#             print("没机会了")
#         else:
#             print("用户名错误还剩{}次".format(i))
#
# else:
#     print("您已尝试3次，请明天再试")

name = "asdadd"
mima = "12313123"
i = 3
while i > 0:
    i = i - 1
    a = input("请输入用户名：")
    b = input("请输入密码：")

    if a == name:
        if b == mima:
            print("欢迎登陆")
            break
        else:
            if i > 0:
                print("密码错误还剩{}次".format(i))
    else:
        if i > 0:
            print("用户名错误还剩{}次".format(i))

else:
    print("没机会了")
    print("您已尝试3次，请明天再试")
